home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fontform
- Caption = "PPFont Demo"
- ClientHeight = 3900
- ClientLeft = 1620
- ClientTop = 1545
- ClientWidth = 5745
- Height = 4305
- Left = 1560
- LinkTopic = "Form2"
- ScaleHeight = 3900
- ScaleWidth = 5745
- Top = 1200
- Width = 5865
- Begin ListBox List2
- Height = 1395
- Left = 3960
- TabIndex = 1
- Top = 600
- Width = 1575
- End
- Begin ListBox List1
- Height = 3150
- Left = 180
- Sorted = -1 'True
- TabIndex = 0
- Top = 600
- Width = 3615
- End
- Begin Label Label2
- Alignment = 2 'Center
- Caption = "True Type Full Names"
- Height = 435
- Left = 4200
- TabIndex = 3
- Top = 120
- Width = 1155
- End
- Begin Label Label1
- Caption = "Family"
- Height = 315
- Left = 180
- TabIndex = 2
- Top = 300
- Width = 1515
- End
- Declare Function PPFontFamNames Lib "PPFONT.DLL" (ByVal hwnd As Integer, afn As lfFaceName, aft As Integer) As Integer
- Declare Function PPFontFamNum Lib "PPFONT.DLL" (ByVal hwnd As Integer) As Integer
- Declare Function PPFontNames Lib "PPFONT.DLL" (ByVal hwnd As Integer, afn As lfFullName, aft As Integer, ByVal afamily As String) As Integer
- Declare Function PPFontNum Lib "PPFONT.DLL" (ByVal hwnd As Integer, ByVal afamily As String) As Integer
- Sub Form_Load ()
- Static ftype() As Integer
- Static lf() As lfFaceName
- n = PPFontFamNum(hwnd)
- ReDim lf(n), ftype(n)
- i = PPFontFamNames(hwnd, lf(1), ftype(1))
- For j = 1 To i
- ft$ = "Vector"
- If ftype(j) And TRUETYPE_FONTTYPE Then
- ft$ = "TrueType"
- Else
- If ftype(j) And RASTER_FONTTYPE Then
- ft$ = "Raster"
- End If
- End If
- font$ = lf(j).FaceName
- For k = 1 To LF_FACESIZE
- If Asc(Mid$(font$, k, 1)) = 0 Then
- Exit For
- End If
- Next
- font$ = Mid$(font$, 1, k - 1)
- l = Len(ft$)
- list1.AddItem font$ + " * " + ft$
- Next
- list1.ListIndex = 4
- list1_click
- End Sub
- Sub list1_click ()
- Static lf() As lfFullName
- Static ftype() As Integer
- list2.Clear
- selfont$ = list1.List(list1.ListIndex)
- n = InStr(selfont$, "*")
- selfont$ = Trim(Mid$(selfont$, 1, n - 4))
- n = PPFontNum(hwnd, selfont$)
- ReDim lf(n), ftype(n)
- i = PPFontNames(hwnd, lf(1), ftype(1), selfont$)
- If ftype(1) And TRUETYPE_FONTTYPE Then
- For j = 1 To i
- list2.AddItem lf(j).FullName
- Next
- End If
- End Sub
-